package net.oschina.app.util;

import android.app.Application;
import android.os.Handler;

import com.orm.SugarContext;

import net.oschina.app.constant.Constants;

import okhttp3.OkHttpClient;

/**
 * Created by YL on 2017/3/20.
 */

public class MApp extends Application{
    public static MApp mApp;
    public static Handler mHandler;
    public static CacheUtils mCacheUtils;

    public static OkHttpClient mClient;
    //public static CacheUtils mCacheUtils;
    @Override
    public void onCreate() {
        super.onCreate();
        mApp = this;
        mHandler = new Handler();
        mCacheUtils = new CacheUtils();
        mClient=new OkHttpClient();
        Constants.Name = PreferencesUtils.getString(this,"name","10.0.2.2");
        Constants.Post = PreferencesUtils.getString(this,"post","8080");
        Constants.refreshUrl();
        SugarContext.init(this);
        SugarContext.terminate();
    }
}
